package com.mdinfo.system.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Created by Administrator on 2017/11/30.
 */
public class EmpParam {

    @Data
    public static class AddParam{

        @NotNull(message = "不能为空")
        @Length(min = 2,max = 10,message = "长度为2-10")
        private String name;

        @NotNull(message = "不能为空")
        @Length(min = 7,max = 20,message = "不能为空")
        private String phoneNum;

        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer deptId;
        private String post;
    }

    @Data
    public static class ModifyParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer empId;

        @NotNull(message = "不能为空")
        @Length(min = 2,max = 10,message = "长度为2-10")
        private String name;

        @NotNull(message = "不能为空")
        @Length(min = 7,max = 20,message = "不能为空")
        private String phoneNum;

        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer deptId;
        private String post;
    }

    @Data
    public static class DeleteParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer empId;
    }

    @Data
    public static class ListQueryParam{
        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer start;

        @NotNull(message = "不能为空")
        @Range(min = 1,max = 50,message = "最小值为1,最大值为50")
        private Integer num;

        private Integer deptId;

        private String key;
    }
}
